package com.aaa.security;

import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Repository;

import javax.servlet.http.HttpServletRequest;

@Repository("rabcConfig")
public class RabcConfig {

    public boolean hasPermission(Authentication authentication, HttpServletRequest request) {
        System.out.println("判断是否有权限");
        // 判断是否登录
        Object principal = authentication.getPrincipal();

        if("anonymousUser".equals(principal)){
            System.out.println("未登录");
            return false;
        }else{
            return true;
        }
    }
}
